<template>
  <div class="base-info">
    <div class="base-info-title">
      {{ goods.title }}
    </div>
    <div class="info-price">
      <span class="new-price">{{ goods.newPrice }}</span>
      <span class="old-price">{{ goods.oldPrice }}</span>
      <span
        class="discount"
        :style="{ backgroundColor: goods.descbgc }"
        v-if="goods.discount"
        >{{ goods.discount }}</span
      >
    </div>
    <div class="columns">
      <div
        class="columns-item"
        v-for="(item, index) in goods.columns"
        :key="index"
      >
        {{ item }}
      </div>
    </div>
    <div class="service">
      <div
        class="service-item"
        v-for="(item, index) in goods.services"
        :key="index"
      >
        <img :src="item.icon" alt="" />
        <span>{{ item.name }}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "DetailBaseInfo",
  props: {
    goods: {
      type: Object,
      default() {
        return {};
      },
    },
  },
};
</script>

<style scoped>
.base-info {
  padding: 10px;
}
.columns {
  margin-top: 20px;
  display: flex;
}
.info-price {
  margin-top: 20px;
}
.new-price {
  font-size: 18px;
  font-weight: 600;
  color: #ff669a;
  padding-right: 5px;
}
.old-price {
  font-size: 12px;
  text-decoration: line-through;
  color: #c2c3c2;
  padding-right: 5px;
}
.columns-item {
  font-size: 14px;
  text-align: left;
  flex: 1;
}
.discount {
  padding: 5px;
  height: 15px;
  line-height: 15px;
  font-size: 12px;
  color: #fff;
  border-radius: 5px;
}

.service {
  margin-top: 20px;
  display: flex;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.service-item {
  flex: 1;
  padding-right: 5px;
  font-size: 12px;
  text-align: left;
}

.service-item img {
  width: 12px;
  height: 12px;
  vertical-align: bottom;
}

.shop-name {
  font-size: 14px;
}
</style>





   